import Vue from 'vue'
import Router from 'vue-router'
import DefaultView from '@/views/DefaultView'
import ShareView from '@/views/ShareView'
import ErrorView from '@/views/ErrorView'
import DiffView from '@/views/DiffView'
import Login from '@/components/Login'

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/diff',
      component: DiffView
    },
    {
      path: '/share',
      component: ShareView
    },
    {
      path: '/error',
      component: ErrorView
    },
    {
      path: '/',
      component: DefaultView
    },
    // {
    //   path: '/',
    //   redirect: '/login'
    // },
    // 登录页面
    {
      path: '/login',
      name: 'login',
      component: Login,
      meta: {
        title: '登录'
      }
    }
  ]
})
